//---------------------------------------------------------------------------

#ifndef mainH
#define mainH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
//---------------------------------------------------------------------------
#include "Locker.h"


class TChildThrd : public TThread
{
private:
	Mutex* fMutex;
	TMemo* fMemo;
	UnicodeString fThrdId;
	bool fAbort;
protected:
	void __fastcall Execute();

public:
	__fastcall TChildThrd(Mutex* aMutex, UnicodeString thrd, TMemo* memo);
	void abort();
};
//---------------------------------------------------------------------------

class TForm1 : public TForm
{
__published:	// IDE-managed Components
	TMemo *Memo1;
	TButton *Button1;
	TEdit *Edit1;
	TLabel *Label1;
	void __fastcall Button1Click(TObject *Sender);
	void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
private:	// User declarations
	Mutex fMutex;
	TChildThrd* thrd1;
	TChildThrd* thrd2;
public:		// User declarations
	__fastcall TForm1(TComponent* Owner);
    __fastcall ~TForm1();
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
